import Request from '@/utils/request'
import type { ArticleParams } from '@/types/article'

/**
 * 获取文章
 */
export const getArticleInfo = (params: any) => {
  return Request.get<ArticleParams[]>('/admin/getarticle', {
    params
  })
}

/**
 * 审核文章
 */
export const checkArticle = (data: ArticleParams) => {
  return Request.put<null>('/admin/checkarticle', data)
}

/**
 * 删除文章
 */
export const delArticle = (id: number) => {
  return Request.delete<null>(`/article/article/${id}`)
}
